package wfm.activiti.util;

import java.util.Comparator;

import org.activiti.engine.task.Task;

public class TaskIdComparator implements Comparator<Task> {
	
	@Override
	  public int compare(Task t1, Task t2) {
	    if (t1.getId() == null && t2.getId() == null) {
	      return 0;
	    }
	    if (t1.getId() == null) {
	      return 1;
	    }
	    if (t2.getId() == null) {
	      return -1;
	    }
	    return Integer.parseInt(t2.getId()) - Integer.parseInt(t1.getId());
	  }
}

